<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<include file="Public:meta" />
	<style>
		.ChannelDepth1{font-weight:bold; color:#000; padding:2px 5px 2px 0px;}
		.ChannelDepth2{color:#000;padding:2px 5px 2px 20px;}
		.ChannelDepth3{color:#000;padding:2px 5px 2px 40px;}
		.ChannelDepth4{color:#000;padding:2px 5px 2px 60px;}
		.ChannelDepth5{color:#000;padding:2px 5px 2px 80px;}
		.ChannelDepth6{color:#000;padding:2px 5px 2px 100px;}
		.ChannelDepth7{color:#000;padding:2px 5px 2px 120px;}
	</style>
</head>
<body id="main_page">
<include file="Public:position" />
<div class="container">
    <div class="box">
        <form enctype="multipart/form-data" action="{$Action}" method="post" id="frmAdd">
        <volist name="Group" id="g">
            <div class="box-header"><h4>{$g.DisplayName}</h4></div>
            <div class="box-content">
                <table class="boxtable">
                <volist name="Attribute" id="a">
                    <eq name="a.GroupID" value="$g.AttributeID">
                        <tr>
                            <th class="w120">{$a.DisplayName}</th>
                            <td>{$a.html}</td>
                        </tr>
                    </eq>
                </volist>
            
                    <tr>
                         <th class="w120">管理组权限</th>
                         <td>
                            <MenuTopList id="mt" MenuOwner="1">
                                <div class="box-header" style="border:1px solid #87A34D;padding:0">
                                <h4 style="color:#000;font-weight:bold;font-size:14px;">
                                    <in name="mt.MenuTopID" value="1,8">
                                        <input type="checkbox" value="{$mt.MenuTopID}" name="MenuTopPurviewXX"  disabled="disabled" checked="checked" />{$mt.MenuTopName}
                                        <input type="hidden" value="{$mt.MenuTopID}" name="MenuTopPurview[]" />
                                    <else/>
                                        <input type="checkbox" value="{$mt.MenuTopID}" name="MenuTopPurview[]" />{$mt.MenuTopName}
                                    </in>
                                    <span style="color:gray;padding-left:10px">注意：如果没有选中上层栏目，则子栏目无效！</span>
                                </h4>
                                <table class="boxtable" style="padding:0">
                                    <MenuGroupList id="mg" MenuTopID="$mt.MenuTopID">
                                        <notin name="mg.MenuGroupID" value="13">
                                            <tr>
                                            <td style="width:200px;text-align:left;color:blue;padding-left:20px;font-weight:bold">
                                            <input type="checkbox" value="{$mg.MenuGroupID}" name="MenuGroupPurview[]" />{$mg.MenuGroupName}
                                            </td>
                                            <td style="text-align:left">
                                                <MenuList id="m" MenuGroupID="$mg.MenuGroupID">
                                                    <notin name="m.MenuID" value="121,96,80,81">
                                                        <eq name="m.MenuType" value="3">
                                                            <ChannelListAdmin id="cl" channelid="0" depth="-1" prefix="">
                                                                <div class="ChannelDepth{$cl.ChannelDepth}">
                                                                <input type="checkbox" value="{$cl.ChannelID}" name="ChannelPurview{$Think.const.LANG_SET}[]" />├─{$cl.ChannelName}
                                                                </div>
                                                            </ChannelListAdmin>
                                                        <else/>
                                                            <span style="padding-right:8px;font-weight:bold">
                                                            <input type="checkbox" value="{$m.MenuID}" name="MenuPurview[]" />{$m.MenuName}
                                                            </span>
                                                        </eq>
                                                    </notin>
                                                </MenuList>
                                            </td>
                                            </tr>
                                        </notin>
                                    </MenuGroupList>
                                </table>
                                </div>
                            </MenuTopList>
                        </td>
                    </tr>
                </table>
        	</div>
         </volist>

            <div class="box-footer">
                <div class="box-footer-inner">
                    <input id="btnSubmit" class="marginright" type="submit" value="保存并继续添加" />
                    <input id="btnSubmit"  type="button" value="返回" class="GoBack"  onclick="GoBack()" />
                </div>
            </div>
        </form>
    </div>
</div>
</body>
</html>
<script type="text/javascript">
	$(document).ready(function(){
		$('#frmAdd').ajaxForm({
			success: complete,
			dataType: 'json'
		});
		
		function complete(data){
			CloseLoadBox();
			if (data.status==1){
				SucceedBox(data.info);
				$('#frmAdd').resetForm();
				$('#AdminGroupName').focus();
            }else{
				ErrorBox(data.info);
			}
		};
		
		 $('#frmAdd').submit(function(){
			LoadBox();
	     	return false;  //为了防止普通浏览器进行表单提交和产生页面导航（防止页面刷新？）返回false  
	     });
		 
		 $('#AdminGroupName').focus();
	});
</script>